﻿using System;
using System.IO;
using System.Windows;
using System.Windows.Media;
using System.Xml;
using System.Xml.Serialization;

namespace AlimentadorGenerator
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        // private RegisterCode m_registerCode;

        // private string m_request;

        public MainWindow()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Confirms window closing if pressed OK button
        /// </summary>
        /// <param name="sender">object</param>
        /// <param name="e">RoutedEventArgs</param>
        private void CancelBtnClick(object sender, RoutedEventArgs e)
        {
            MessageBoxResult res = MessageBox.Show("Tem a certeza que quer fechar a aplicação?", "Aviso", MessageBoxButton.OKCancel);
            if (res == MessageBoxResult.OK)
            {
                this.Close();
            }
        }

        private void ContinueBtnClick(object sender, RoutedEventArgs e)
        {
            GenerateOption.Visibility =
                ContinueBtn.Visibility = System.Windows.Visibility.Collapsed;

            ValidateOption.Visibility =
                RestartBtn.Visibility = System.Windows.Visibility.Visible;

            ValidateOption.SetRegisterCode = GenerateOption.GetRegisterCode;
        }

        private void RestartBtnClick(object sender, RoutedEventArgs e)
        {
            GenerateOption.Visibility =
                ContinueBtn.Visibility = System.Windows.Visibility.Visible;

            ValidateOption.Visibility =
                RestartBtn.Visibility = System.Windows.Visibility.Collapsed;
        }
    }
}
